package com.bao.demo.work.test02;

public class TestStudent {
    public static void main(String[] args) {
        Student[] students=new Student[5];
        students[0]=new Student("10001","小明","男",18,59);
        students[1]=new Student("10002","中明","男",28,69);
        students[2]=new Student("10003","大明","男",48,79);
        students[3]=new Student("10004","老明","男",78,89);
        students[4]=new Student("10005","死明","男",98,99);
        int max=students[0].getsJava();
        int min=students[0].getsJava();
        double sum=0.0;

        for(int i=1;i<students.length;i++){
            if(max<students[i].getsJava()){
                max=students[i].getsJava();
            }
            if(min>students[i].getsJava()){
                min=students[i].getsJava();
            }
            sum+=students[i].getsJava();
        }
        System.out.println("最高分："+max+"，最低分："+min+"，平均分："+sum/students.length);
    }
}
